/* 所有的首页懒加载页面所使用的js
 * @author 王校兵
 * @date 2016-7-20
 * @version 1.0
 */

//拼接商品区域（类型一 ：拼接类型左方商品,广告与商品分离）
function combineGoodsOne(title, rightTitle, data, newsTitle, newsData) {
	// 最外层div
	var html = "<div class='common_three_ad_left'>";

	// 标题部分
	html += "<div class='common_three_ad_topic' id='common'>";
	html += "<div style='width:98%; margin:0 auto; border: 2px solid #ff0000; float:left; margin-top:2%;'></div>";
	html += "<div class='common_three_ad_topic_title'>";
	html += "<font><b>" + title + "</b></font>";
	html += "</div>";
	html += "<div class='common_three_ad_topic_index'>";

	for (var index = 0; index < rightTitle.length; index++) {
		html += "<a href=" + rightTitle[index][0] + ">" + rightTitle[index][1]
				+ "</a>";
	}

	html += "</div>";
	html += "<div style='width:98%; margin:0 auto; border: 1px dashed #000; float:left;'></div>";
	html += "</div>";

	// 商品左边大广告
	html += "<div class='common_three_ad_big_img'>";
	html += "<a href=" + data[0][2] + "><img src=" + data[0][0] + " alt="
			+ data[0][1] + "></img></a>";
	html += "</div>";

	// 商品
	// 商品最外边包裹div
	html += "<div class='common_three_ad_goods'>";

	// 八个商品部分
	for (var index = 1; index <= 8; index++) {
		html += "<div class='common_three_ad_goods_info'>";
		html += "<a href=" + data[index][2] + "><img  src=" + data[index][0]
				+ " alt=" + data[index][1] + " /></a>";
		html += "<div class='common_three_ad_goods_info_text'>";
		html += "<div class='common_three_ad_goods_info_text_head'>";
		html += "<div class='common_three_ad_goods_info_text_head_left'>￥"
				+ data[index][4] + "</div>";
		html += "<div class='common_three_ad_goods_info_text_head_right'>评价:"
				+ data[index][5] + "</div>";
		html += "</div>";
		html += "<div class='common_three_ad_goods_info_text_min'>";
		html += "<a href=" + data[index][2] + ">" + data[index][3] + "</a>";
		html += "</div>";

		// 以下三个为商品下方小图标
		html += "<div class='common_three_ad_bottom'>";
		html += "<img src='images/img_05_34.jpg'/>";
		html += "</div>";
		// 关闭div
		html += "</div>";
		html += "</div>";

	}
	;

	// div关闭
	html += "</div>";
	html += "</div>";

	// 商品右部分
	html += "<div class='common_three_ad_right'>";

	html += "<div class='xinwen_right_title'>"
			+ "<div style='width:98%; margin:0 auto; border: 2px solid #FF0000; float:left; margin-top:5%;'></div>"
			+ "<font style='margin-left:10%; line-height:30px;'>" + newsTitle
			+ "</font>" + "</div>" + "<div class='xinwem_right_title_img'>"
			+ "<a href=" + newsData[0][1] + "><img src=" + newsData[0][2]
			+ " style='width:100%; height:160px;' /></a>"
			+ "<div class='xinwen_left_left_img_text'><a href="
			+ newsData[0][1] + ">" + newsData[0][0] + "</a></div>" + "</div>"
			+ "<div class='xinwen_right_text'>"
			+ "<ul style='margin-top:0; padding-top:3%;'>";

	for (var index = 1; index < 9; index++) {

		html += "<li><a href=" + newsData[index][1] + ">" + newsData[index][0]
				+ "</a></li>";

	}

	html += "</div>";

	html += "</div>";

	// 至此商品区域完成，关闭商品区域和右方区域
	html += "</div>";
	return html;
};

// 拼接商品区域（类型二 ：拼接类型左方商品,广告与商品在一起）
function combineGoodsTwo(title, rightTitle, data, newsTitle, newsData) {
	// 最外层div
	var html = "<div class='mainbody_common_short_ad' id='common_short_ad'>";

	// 标题部分
	html += "<div style='width:73%; margin:0 auto; border: 2px solid #ff0000; float:left; margin-top:2%;'></div>";
	html += "<div class='common_three_ad_left' >";
	html += "<div class='common_three_ad_topic_title'>";
	html += "<font><b>" + title + "</b></font>";
	html += "</div>";

	html += "<div class='common_three_ad_topic_index'>";
	for (var index = 0; index < rightTitle.length; index++) {
		html += "<a href=" + rightTitle[index][0] + ">" + rightTitle[index][1]
				+ "</a>";
	}
	html += "</div>";
	// 红线
	html += "<div style='width:98%; margin:0 auto; border: 1px dashed #000; float:left;'></div>";

	// 商品左边大广告
	html += "<div class='common_three_ad_big_img'>";
	html += "<a href=" + data[0][2] + "><img src=" + data[0][0] + " alt="
			+ data[0][1] + "></img></a>";
	html += "</div>";

	// 商品
	// 商品最外边包裹div
	html += "<div class='common_three_ad_goods'>";

	// 八个商品部分
	for (var index = 1; index <= 8; index++) {
		html += "<div class='common_three_ad_goods_info'>";
		html += "<a href=" + data[index][2] + "><img  src=" + data[index][0]
				+ " alt=" + data[index][1] + " /></a>";
		html += "<div class='common_three_ad_goods_info_text'>";
		html += "<div class='common_three_ad_goods_info_text_head'>";
		html += "<div class='common_three_ad_goods_info_text_head_left'>￥"
				+ data[index][4] + "</div>";
		html += "<div class='common_three_ad_goods_info_text_head_right'>评价:"
				+ data[index][5] + "</div>";
		html += "</div>";
		html += "<div class='common_three_ad_goods_info_text_min'>";
		html += "<a href=" + data[index][2] + ">" + data[index][3] + "</a>";
		html += "</div>";

		// 以下三个为商品下方小图标
		html += "<div class='common_three_ad_bottom'>";
		html += "<img src='images/img_05_34.jpg'/>";
		html += "</div>";
		// 关闭div
		html += "</div>";
		html += "</div>";

	}
	;

	// div关闭
	html += "</div>";

	// 商品下方广告条
	html += "<div class='common_short_ad_ad'>";
	// html += "<a href=" + data[9][2] + "><img src=" + data[9][0] + " alt="
	// + data[9][1] + " /></a>";
	html += "</div>";

	html += "</div>";

	// 商品右部分
	html += "<div class='common_short_ad_right'>";

	
	
	
	html += "<div class='xinwen_right_title'>"
		+ "<div style='width:98%; margin:0 auto; border: 2px solid #FF0000; float:left; margin-top:5%;'></div>"
		+ "<font style='margin-left:10%; line-height:30px;'>" + newsTitle
		+ "</font>" + "</div>" + "<div class='xinwem_right_title_img'>"
		+ "<a href=" + newsData[0][1] + "><img src=" + newsData[0][2]
		+ " style='width:100%; height:160px;' /></a>"
		+ "<div class='xinwen_left_left_img_text'><a href="
		+ newsData[0][1] + ">" + newsData[0][0] + "</a></div>" + "</div>"
		+ "<div class='xinwen_right_text'>"
		+ "<ul style='margin-top:0; padding-top:3%;'>";
	for (var index = 2; index < 9; index++) {

		html += "<li><a href=" + newsData[index][1] + ">" + newsData[index][0]
				+ "</a></li>";

	}
	html += "</div>";
	
	
	
	
	

	html += "</div>";

	html += "</div>";
	return html;
};

// 拼接商品下方广告条类型一（三个广告条并列）
function combineBottomAdOne(first, second, third) {

	var html = "<div class='three_ad_single'><a href=" + first[2]
			+ "><img src=" + first[0] + " width='' height='' alt=" + first[1]
			+ "/></a></div>" + "<div class='three_ad_single'><a href="
			+ second[2] + "><img src=" + second[0] + " width='' height='' alt="
			+ second[1] + "/></a></div>"
			+ "<div class='three_ad_single'><a href=" + third[2] + "><img src="
			+ third[0] + " width='' height='' alt=" + third[1] + "/></a></div>";

	return html;

};

// 拼接商品下方广告条类型二（一个广告条长）
function combineBottomAdTwo(data) {

	var html = "<div class='long_ad' style='height:110px;'>";
	html += "<a href="
			+ data[2]
			+ "><img  src="
			+ data[0]
			+ " alt="
			+ data[1]
			+ " width='' height='' style='width:100%; height:85px; margin-top:2%;'/></a>";
	html += "</div>";

	return html;
};

// 拼接商品下方广告条类型三（一个广告条短）
function combineBottomAdThree(data) {
	var html = "<div class=''><a href=" + data[2] + "><img  src=" + data[0]
			+ " alt=" + data[1] + " width='' height=''/></a></div>";
	return html;
};

// 艺术家推荐10个
function combineTenArtist(data) {
	var html = "";
	for (var index = 0; index < 10; index++) {
		html += "<div class='ten_ad_pic'><a href="
				+ data[index + 9][2]
				+ "><img  src="
				+ data[index + 9][0]
				+ " alt="
				+ data[index + 9][1]
				+ " width='' height='' style='width:100%; float:left;'/></a></div>";
	}
	return html;
}

// 艺术家推荐40个
function combineFortyArtist(data) {
	var html = "";

	for (var index1 = 0; index1 < 4; index1++) {

		html += "<div style='width:100%'>";

		for (var index2 = 0; index2 < 10; index2++) {
			html += "<div class='ten_ad_pic'><a href="
					+ data[2]
					+ "><img  src="
					+ data[0]
					+ " alt="
					+ data[1]
					+ " width='' height='' style='width:100%; float:left;'/></a></div>";
		}
		html += "</div>";
	}

	return html;
}
